package com.px.idal;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.px.model.ReviewProjectRel;

public interface IReviewProjectRelMapper {
	/**
	 * 查询方法
	 * 查询所有项目与评审组
	 * 使用@Select 注解指明getAllUsers方法要执行的SQL
	 * @param <ReviewProjiveRelInfo>
	 * */
	@Select("select * from review_project_rel_tb")
	public List<ReviewProjectRel> getAllReviewProjectRel();

	/**
	 * 查询方法
	 * 查询指定id用户
	 * 使用@Select 注解指明getAllUsersByUserId方法要执行的SQL
	 * */
	@Select("select * from review_project_rel_tb where review_project_rel_id=#{review_project_rel_id}")
	public List<ReviewProjectRel> getReviewProjectByReviewProjectId(ReviewProjectRel review);

	/**
	 * Insert方法
	 * 增加项目与评审组
	 * 传参为对象方法
	 * */
	@Insert("insert into review_project_rel_tb(project_id,review_id)value(#{project_id},#{review_id})")
	public int insertReviewProjectRel(ReviewProjectRel review);

	/**
	 * 更新方法
	 * 更新指定review_project_rel_id的项目与评审组的项目id和项目组id
	 * 示例
	 * */
	@Update("update review_project_rel_tb  set project_id=#{project_id},review_id=#{review_id} where review_project_rel_id=#{review_project_rel_id}")
	public int updateReviewProjectRelByReviewProjectRelId(ReviewProjectRel review);

	/**
	 * 删除方法
	 * 删除指定review_project_rel_id的项目与评审组
	 * 示例
	 * */
	@Delete("delete from review_project_rel_tb where review_project_rel_id=#{review_project_rel_id}")
	public int deleteReviewProjectRelByReviewProjectRelid(ReviewProjectRel review);

	/**
	 * 查询项目与评审组信息总条数
	 * 
	 * */
	@Select("select count(*) from review_project_rel_tb")
	public int getAllReviewProjectRelCounts();

	/**
	 * 查询指定项目与评审组名项目与评审组是否存在
	 * 
	 * */
	@Select("select count(*) from review_project_rel_tb where review_project_rel_id=#{review_project_rel_id}")
	public int checkReviewProjectRelIdIsExist(ReviewProjectRel review);

}
